// 定义枚举类型
enum Direction {
    UP,
    DOWN,
    LEFT,
    RIGHT,
}

const d1: Direction = Direction.UP
const d2: Direction = Direction.DOWN
const d3: Direction = Direction.LEFT
const d4: Direction = Direction.RIGHT

function turnDirection(direction: Direction) {
    switch (direction) {
        case Direction.LEFT:
            console.log("角色向左移动一个空格")
            break
        case Direction.RIGHT:
            console.log("角色向左移动一个空格")
            break
        default:
            break
    }
}

// 监听键盘的点击
turnDirection(Direction.LEFT)

export {}
